﻿#ifndef PERSONCONTROLLER_H
#define PERSONCONTROLLER_H
#include "QString"
#include "iostream"
#include "QList"

class PersonController
{
public:
    PersonController();
   //上层信息返回函数
    static QList<QList<QString>> search(QString name);//以姓名搜索
    static QList<QString> hasEqualsElement(QString element, int eleIndex,int pageIndex);//判断是否存在相同联系人
    static QList<QString> hasEqualsElement(QList<QString> list, int eleIndex,int pageIndex);
    static bool addPerson(QList<QString> list,int index);//添加用户
    static bool deletePerson(QString name);//删除用户
    static bool deletePersonJudge(int index,QString name);//删除用户
    static bool editPerson(QList<QString> list);//删除用户
    static bool editPersonJudge(int index,QList<QString> list);//删除用户

    //文件处理函数
    static void DeleteOneline(int nNum, QString &strall);//删除某一行数据
    static void editOneLine(int nNum,QString &strall);//编辑某一行的信息
    static void writeFinalInFile(int nNumLine, QString &filename);//写入最终文件


    static void printQList(QList<QString> list);//调试信息，打印某一行的信息
    static void printQList(QList<QList<QString>> list);//打印所有信息

    static void getPhoneNum();
    static void getSimNum();
private:
    int simNum;
    int phoneNum;

};

#endif // PERSONCONTROLLER_H

